package cn.kgc.springcloud.controller;

import cn.kgc.springcloud.dto.StudentDTO;
import cn.kgc.springcloud.service.StudentService;
import cn.kgc.springcloud.vo.StudentVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: 课工场
 * @Version: v1.0  2023/4/28
 * @Description:
 */
@RestController
@RequestMapping("student")
public class StudentController {

    @Autowired
    private StudentService studentService;
    @GetMapping
    public List<StudentVO> getList() {

        return  studentService.getList();
    }


    @PostMapping
    public StudentVO add(@RequestBody StudentDTO studentDTO) {
        return  studentService.add(studentDTO);
    }

}
